<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>物流公司管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	#parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid">
   	<div class="layui-form" id="LAY-form">
		#if($id)
		<input type="hidden" name="id" value="$!{id}"/>
		<div class="layui-form-item">
            <label class="layui-form-label">物流公司</label>
            <div class="layui-form-mid layui-word-aux">$!{name}</div>
        </div>
		#else
		<div class="layui-form-item">
			<label class="layui-form-label">物流公司</label>
			<div class="layui-input-block">
				<select name="companyId" id="companyId" class="layui-hide" lay-ignore></select>
			</div>
		</div>
		#end
		<div class="layui-form-item">
			<label class="layui-form-label">联系人</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="contactName" placeholder="请输入物流联系人姓名" autocomplete="off" value="$!{contactName}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">联系电话</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="contactPhone" placeholder="请输入物流联系电话" autocomplete="off" value="$!{contactPhone}">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-block">
				<select name="state">
					#foreach($item in $stateList)
					<option value="$!{item.index()}" $!{utils.eq($state,$item.index(),'selected')}>$!{item.note()}</option>
					#end
				</select>
			</div>
		</div>
	    <div class="layui-form-item layui-hide">
	    	<input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  		</div>
	</div>
</div>
#parse('/footFiles.html')
<script type="text/javascript">
layui.config({
  base: '$!{webRoot}/assets/layuiadmin/'
}).extend({
  index: 'lib/index'
}).use(['index', 'form'],function(){
	
	$('#companyId').select2({
	    placeholder: "请选择物流公司",
	    width: '300px',
	    theme: 'bootstrap',
	    allowClear : true,
	    ajax: {
	      url: '$!{webRoot}/market/logistics_company/cloud/select.data',
	      method: 'post',
	      delay: 250,
	      processResults: function (result) {
	        if (result.code == 200) {
	          return {
	            pagination: {more: result.body.more},
	            results: result.body.data || []
	          };
	        } else {
	          return {results: []};
	        }
	      }
	    }
	  });
	
});
</script>
</body>
</html>